package com.punch.order.controller;


import com.punch.order.service.OrderCourseSnapshotService;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 * 订单课程快照表 前端控制器
 * </p>
 *
 * @author wjj
 * @since 2020-12-09
 */
@RestController
@Api(hidden = true)
public class OrderCourseSnapshotController {

    @Resource
    private OrderCourseSnapshotService orderCourseSnapshotService;

    /**
     * 学生是否报名该课程
     *
     * @param classId   课程班级id
     * @param studentId 学生id
     * @return boolean
     */
    @GetMapping(value = "/order/course/{classId}/student/{studentId}", produces = "application/json; charset=utf-8")
    public boolean isSignUp(@PathVariable("classId") Long classId, @PathVariable("studentId") Long studentId) {
        return orderCourseSnapshotService.isSignUp(classId, studentId);
    }
}
